package com.cole.gx095.Repository;

import com.cole.gx095.entity.Purchasebill;
import com.cole.gx095.entity.Purchasecontract;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface PurchasecontractRepository extends JpaRepository<Purchasecontract,Integer>, JpaSpecificationExecutor<Purchasecontract> {
    @Query(value = "select sum(contractAmount) from purchasecontract",nativeQuery = true)
    Long sumAmount();

    @Query(value = "select * from purchasecontract p where p.contractNum = ?1", nativeQuery = true)
    Purchasecontract findoneBycontractNum(String contractNum);
}
